import { request } from "@umijs/max";
import { stringify } from 'qs';

//文章列表
export const getArticlePage = (params: any) =>
  request(`/article/back-page?${stringify(params)}`, {
    method: "GET",
  });

  //审核/驳回文章
export const changeArticleStatus = (params:{
      /**
     * 文章ID集合
     */
      articleIds: string[];
      /**
       * 驳回/通过发布成功的status
       */
      status: number;
}) =>
request(`/article/audit?articleIds=${params.articleIds[0]}&status=${params.status}&message=${params.message??''}`, {
  method: "PUT",
});

  //删除文章
  export const delArticle = (id:any) =>
  request(`/article/${id}`, {
    method: "DELETE",
  });